import java.io.File;
import java.io.FileNotFoundException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 涛
 * Date: 2023-09-21
 * Time: 19:46
 */
class Confi {
    File file;
    public void openConfig(String filename) throws FileNotFoundException{
        if(!filename.equals("config.in")) {
            throw new FileNotFoundException("文件名不对");
        }
    }
    //打开文件
    public void readConfig() {

    }
}


public class Test3 {
    public static void main(String[] args){
        Confi config = new Confi();
        try {
            config.openConfig("config.in");
            System.out.println("文件打开成功");
        } catch(FileNotFoundException e) {
            e.printStackTrace();
        }
        System.out.println("异常被处理了，这里的代码可以执行");
    }

}
